/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.evl.tecinfo.gui;

import java.awt.Color;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Tecinfo
 */
public class Principal extends javax.swing.JFrame {
    Funcionarios janelafuncionario = new Funcionarios();
    CadastrarUsuario janelacadastra_usuario = new CadastrarUsuario();
    Cargo_gui janelacargo = new Cargo_gui();
    Entrar janelaentrar = new Entrar();
    Registrar_horaextra janelaregistrar = new Registrar_horaextra();
    Relatorios janelarelatorios = new Relatorios();
    Sobre janelasobre = new Sobre();
    Nova_area janelaarea = new Nova_area();

    
    int linha_editar = -1;
    int linha_selec = -1;
    /**
     * Creates new form Principal
     */
    public Principal() {
        initComponents();
         setSize(1024,640);
         
        janelafuncionario.setSize(1024,640);
        
        janelacadastra_usuario.setSize(1024,640);
        janelacargo.setSize(1024,640);
        janelaentrar.setSize(640, 480);
        janelaregistrar.setSize(1024,640);
        janelarelatorios.setSize(1024,640);
        janelasobre.setSize(640, 480);
        janelaarea.setSize(1024,640);

    }
    

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jl_prin_login = new javax.swing.JLabel();
        jl_princ_nome = new javax.swing.JLabel();
        ct_princ_nome = new javax.swing.JTextField();
        jl_princ_cpf = new javax.swing.JLabel();
        jt_princ_cpf = new javax.swing.JTextField();
        bt_princ_entrar = new javax.swing.JButton();
        bar = new javax.swing.JMenuBar();
        bar.setVisible(false);
        menu_login = new javax.swing.JMenu();
        mn_cadastre_se = new javax.swing.JMenuItem();
        jr_sair = new javax.swing.JRadioButtonMenuItem();
        mn_cadastrar = new javax.swing.JMenu();
        mn_area = new javax.swing.JMenuItem();
        mn_cargo = new javax.swing.JMenuItem();
        mn_func = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        mn_reg = new javax.swing.JMenuItem();
        mn_relatorio = new javax.swing.JMenuItem();
        jMenu4 = new javax.swing.JMenu();
        mn_sobre = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                FecharJanelaPrincipal(evt);
            }
        });

        jl_prin_login.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jl_prin_login.setForeground(new java.awt.Color(255, 255, 255));
        jl_prin_login.setText("Login");

        jl_princ_nome.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jl_princ_nome.setForeground(new java.awt.Color(255, 255, 255));
        jl_princ_nome.setText("Nome ");

        jl_princ_cpf.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jl_princ_cpf.setForeground(new java.awt.Color(255, 255, 255));
        jl_princ_cpf.setText("CPF");

        bt_princ_entrar.setText("Entrar");
        bt_princ_entrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_princ_entrarActionPerformed(evt);
            }
        });

        menu_login.setText("Login");

        mn_cadastre_se.setText("Cadastre-se");
        mn_cadastre_se.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mn_cadastre_seActionPerformed(evt);
            }
        });
        menu_login.add(mn_cadastre_se);

        jr_sair.setText("Sair");
        jr_sair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jr_sairActionPerformed(evt);
            }
        });
        menu_login.add(jr_sair);

        bar.add(menu_login);

        mn_cadastrar.setText("Cadastrar");

        mn_area.setText("Área");
        mn_area.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mn_areaActionPerformed(evt);
            }
        });
        mn_cadastrar.add(mn_area);

        mn_cargo.setText("Cargo");
        mn_cargo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mn_cargoActionPerformed(evt);
            }
        });
        mn_cadastrar.add(mn_cargo);

        mn_func.setText("Funcionário");
        mn_func.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mn_funcActionPerformed(evt);
            }
        });
        mn_cadastrar.add(mn_func);

        bar.add(mn_cadastrar);

        jMenu3.setText("Registrar Hora Extra");

        mn_reg.setText("Registrar");
        mn_reg.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mn_regActionPerformed(evt);
            }
        });
        jMenu3.add(mn_reg);

        mn_relatorio.setText("Relatório");
        mn_relatorio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mn_relatorioActionPerformed(evt);
            }
        });
        jMenu3.add(mn_relatorio);

        bar.add(jMenu3);

        jMenu4.setText("Outras Opções");

        mn_sobre.setText("Sobre");
        mn_sobre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mn_sobreActionPerformed(evt);
            }
        });
        jMenu4.add(mn_sobre);

        bar.add(jMenu4);

        setJMenuBar(bar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(220, 220, 220)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jl_princ_cpf)
                            .addComponent(jl_princ_nome, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(ct_princ_nome, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jt_princ_cpf, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(310, 310, 310)
                        .addComponent(jl_prin_login, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(360, 360, 360)
                        .addComponent(bt_princ_entrar)))
                .addContainerGap(735, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(66, 66, 66)
                        .addComponent(jl_prin_login, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(16, 16, 16)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ct_princ_nome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jl_princ_nome, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(20, 20, 20)
                        .addComponent(jt_princ_cpf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(168, 168, 168)
                        .addComponent(jl_princ_cpf)
                        .addGap(33, 33, 33)
                        .addComponent(bt_princ_entrar)))
                .addGap(507, 507, 507))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jr_sairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jr_sairActionPerformed
        // TODO add your handling code here:
        int clicou_ok = JOptionPane.showConfirmDialog(null, "Deseja sair do programa?", "Informação", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE);
     
      if (clicou_ok == JOptionPane.YES_OPTION){
              System.exit(0);
      }else if (clicou_ok == JOptionPane.NO_OPTION){
                
      }else if (clicou_ok == JOptionPane.CLOSED_OPTION){
     
      }
      
     
    }//GEN-LAST:event_jr_sairActionPerformed

     
     private void jb_rem_cadActionPerformed(java.awt.event.ActionEvent evt) {                                              
        // TODO add your handling code here:
    }
    
    private void jb_edit_cargoActionPerformed(java.awt.event.ActionEvent evt) {                                              
        // TODO add your handling code here:
  
    }                                             


    
    private void mn_sobreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mn_sobreActionPerformed
        // TODO add your handling code here:
        janelasobre.setVisible(true);
    }//GEN-LAST:event_mn_sobreActionPerformed

    private void mn_regActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mn_regActionPerformed
        // TODO add your handling code here:
        janelaregistrar.setVisible(true);
    }//GEN-LAST:event_mn_regActionPerformed

    private void mn_relatorioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mn_relatorioActionPerformed
        // TODO add your handling code here:
        janelarelatorios.setVisible(true);
    }//GEN-LAST:event_mn_relatorioActionPerformed

    private void mn_areaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mn_areaActionPerformed
        // TODO add your handling code here:
       janelaarea.setVisible(true);
    }//GEN-LAST:event_mn_areaActionPerformed

    private void mn_cargoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mn_cargoActionPerformed
        // TODO add your handling code here:
        janelacargo.setVisible(true);
    }//GEN-LAST:event_mn_cargoActionPerformed

    private void mn_funcActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mn_funcActionPerformed
        // TODO add your handling code here:
        janelafuncionario.setVisible(true);
    }//GEN-LAST:event_mn_funcActionPerformed

    private void mn_cadastre_seActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mn_cadastre_seActionPerformed
        // TODO add your handling code here:
        janelacadastra_usuario.setVisible(true);
    }//GEN-LAST:event_mn_cadastre_seActionPerformed

    private void bt_princ_entrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_princ_entrarActionPerformed
        // TODO add your handling code here:
        bar.setVisible(true);
        ct_princ_nome.setVisible(false);
        jt_princ_cpf.setVisible(false);
        jl_prin_login.setVisible(false);
        jl_princ_nome.setVisible(false);
        jl_princ_cpf.setVisible(false);
        bt_princ_entrar.setVisible(false);
    }//GEN-LAST:event_bt_princ_entrarActionPerformed

    private void FecharJanelaPrincipal(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_FecharJanelaPrincipal
        // TODO add your handling code here:
        int clicou_ok = JOptionPane.showConfirmDialog(null, "Deseja sair do programa?", "Informação", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE);
     
      if (clicou_ok == JOptionPane.YES_OPTION){
              System.exit(0);
      }else if (clicou_ok == JOptionPane.NO_OPTION){
                
      }else if (clicou_ok == JOptionPane.CLOSED_OPTION){
     
      }
    }//GEN-LAST:event_FecharJanelaPrincipal

    private void ct_cod_cargoActionPerformed(java.awt.event.ActionEvent evt) {                                              
        // TODO add your handling code here:
    }
    private void jb_lim_carActionPerformed(java.awt.event.ActionEvent evt) {                                              
        // TODO add your handling code here:
    }  
    
    
    private void bt_cad_cargoActionPerformed(java.awt.event.ActionEvent evt) {                                              
        // TODO add your handling code here:
    }  
    
    
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Principal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuBar bar;
    private javax.swing.JButton bt_princ_entrar;
    private javax.swing.JTextField ct_princ_nome;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JLabel jl_prin_login;
    private javax.swing.JLabel jl_princ_cpf;
    private javax.swing.JLabel jl_princ_nome;
    private javax.swing.JRadioButtonMenuItem jr_sair;
    private javax.swing.JTextField jt_princ_cpf;
    private javax.swing.JMenu menu_login;
    private javax.swing.JMenuItem mn_area;
    private javax.swing.JMenu mn_cadastrar;
    private javax.swing.JMenuItem mn_cadastre_se;
    private javax.swing.JMenuItem mn_cargo;
    private javax.swing.JMenuItem mn_func;
    private javax.swing.JMenuItem mn_reg;
    private javax.swing.JMenuItem mn_relatorio;
    private javax.swing.JMenuItem mn_sobre;
    // End of variables declaration//GEN-END:variables
}
